function fin=A_2entradas(x)
global xt
global yt
global y1
global iteracion
global RMSEs
iteracion=iteracion+1

if ceil(abs(x(1)))>100
    hiddenLayerSize=100;
else hiddenLayerSize=ceil(abs(x(1)));
end
hiddenLayerSize 
valor_transferFcn_1=ceil(abs(x(2)));
valor_transferFcn_2=ceil(abs(x(3)));
valor_trainFcn=ceil(abs(x(4)));

if valor_transferFcn_1>15 | valor_transferFcn_2>15 | valor_trainFcn>9
    valor_transferFcn_1=15;
    valor_transferFcn_2=15;
    valor_trainFcn=9;
end

x_h=x(5:length(x));
longitud_x_h=length(x_h);
x_v=x(5:length(x))';

net = feedforwardnet(hiddenLayerSize);

net.divideParam.trainRatio=70/100;
net.divideParam.valRatio=15/100;
net.divideParam.testRatio=15/100;

net = configure(net,xt,yt);
net.layers{1}.size=hiddenLayerSize;
vector=zeros(hiddenLayerSize,2);
p=1;
for i=1:hiddenLayerSize
    for j=1:2
        vector(i,j)=x_h(p);
        p=1+p;
    end
end
net.IW{1}=vector;
net.LW{2}=x_h(p:p+hiddenLayerSize-1);
net.b{1}=x_v(p+hiddenLayerSize:p+hiddenLayerSize*2-1);
net.b{2}=x_h(p+hiddenLayerSize*2);

switch valor_trainFcn
    case 1
        net.trainFcn='trainlm';
    case 2
        net.trainFcn='trainbfg';
    case 3
        net.trainFcn='trainrp';
    case 4
        net.trainFcn='trainscg';
    case 5
        net.trainFcn='traincgb';
    case 6
        net.trainFcn='traincgf';
    case 7
        net.trainFcn='traincgp';
    case 8
        net.trainFcn='trainoss';
    case 9
        net.trainFcn='traingdx';
end
switch valor_transferFcn_1
    case 1
        net.layers{1}.transferFcn='compet';
    case 2
        net.layers{1}.transferFcn='elliotsig';
    case 3
        net.layers{1}.transferFcn='hardlim';
    case 4
        net.layers{1}.transferFcn='hardlims';
    case 5
        net.layers{1}.transferFcn='logsig';
    case 6
        net.layers{1}.transferFcn='netinv';
    case 7
        net.layers{1}.transferFcn='poslin';
    case 8
        net.layers{1}.transferFcn='purelin';
    case 9
        net.layers{1}.transferFcn='radbas';
    case 10
        net.layers{1}.transferFcn='radbasn';
    case 11
        net.layers{1}.transferFcn='satlin';
    case 12
        net.layers{1}.transferFcn='satlins';
    case 13
        net.layers{1}.transferFcn='softmax';
    case 14
        net.layers{1}.transferFcn='tansig';
    case 15
        net.layers{1}.transferFcn='tribas';
end
switch valor_transferFcn_2
    case 1
        net.layers{2}.transferFcn='compet';
    case 2
        net.layers{2}.transferFcn='elliotsig';
    case 3
        net.layers{2}.transferFcn='hardlim';
    case 4
        net.layers{2}.transferFcn='hardlims';
    case 5
        net.layers{2}.transferFcn='logsig';
    case 6
        net.layers{2}.transferFcn='netinv';
    case 7
        net.layers{2}.transferFcn='poslin';
    case 8
        net.layers{2}.transferFcn='purelin';
    case 9
        net.layers{2}.transferFcn='radbas';
    case 10
        net.layers{2}.transferFcn='radbasn';
    case 11
        net.layers{2}.transferFcn='satlin';
    case 12
        net.layers{2}.transferFcn='satlins';
    case 13
        net.layers{2}.transferFcn='softmax';
    case 14
        net.layers{2}.transferFcn='tansig';
    case 15
        net.layers{2}.transferFcn='tribas';
end

entrenamiento_yt=(net(xt))';
global entrenamiento_yt_desnorm
entrenamiento_yt_desnorm=entrenamiento_yt*(max(y1)-min(y1))+min(y1);
RMSE_train=sqrt((sum((entrenamiento_yt_desnorm-y1).^2))/length(y1))
fin=RMSE_train;